#ifndef _CAMERA_H_
#define _CAMERA_H_

#include <d3dx9.h>

class Camera
{
public:
	
	Camera();
	~Camera();

	bool Create( IDirect3DDevice9	*pDevice );
	
	void Move( float x, float y, float z );
	void Move( const D3DXVECTOR3 &vMove );

	void SetPosition( float x, float y, float z );
	void SetPosition( const D3DXVECTOR3 &Pos );
	void SetLook( float x, float y, float z );
	void SetLook( const D3DXVECTOR3 &Look );


	D3DXMATRIXA16	&GetViewMatrix();

	void Update( float Time );

	void Pitch( float Angle );
	void Yaw( float Angle );
	void Roll( float Angle );

	D3DXVECTOR3	&GetPosition()	{ return m_vPos; }
	D3DXVECTOR3	&GetUp()		{ return m_vUp; }
	D3DXVECTOR3	&GetLook()		{ return m_vLook; }


protected:

	void _Update();

	IDirect3DDevice9		*m_pkDevice;

	D3DXVECTOR3				m_vRight;
	D3DXVECTOR3				m_vUp;
	D3DXVECTOR3				m_vLook;
	D3DXVECTOR3				m_vPos;

	D3DXMATRIXA16			m_View;
	D3DXMATRIXA16			m_Proj;
	D3DXMATRIXA16			m_Temp;
};

#endif